package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipMaintainSpareReplaceService;
import cc.comac.mom.bean.EquipMaintainSpareReplace;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/EquipMaintainSpareReplace")
public class EquipMaintainSpareReplaceController {

	@Autowired
	private EquipMaintainSpareReplaceService equipMaintainSpareReplaceService;
	@ApiOperation("查询")
	@RequestMapping(value = "/selectSomeByFields", method = RequestMethod.POST)
	public ResultBean selectSomeByFields(@RequestBody EquipMaintainSpareReplace equipMaintainSpareReplace) {
		ResultBean selectSomeByFields = equipMaintainSpareReplaceService.selectSomeByFields(equipMaintainSpareReplace);
		return selectSomeByFields;
	}

	@ApiOperation("删除按钮")
	@RequestMapping(value = "/deleteSpareReplace", method = RequestMethod.POST)
	public ResultBean deleteSpareReplace(@RequestBody List<EquipMaintainSpareReplace> spareReplaceList) {
		ResultBean deleteSpareReplace = equipMaintainSpareReplaceService.deleteSpareReplace(spareReplaceList);
		return deleteSpareReplace;
	}

	@ApiOperation("修改按钮")
	@RequestMapping(value = "/updateSpareReplace", method = RequestMethod.POST)
	public ResultBean updateSpareReplace(@RequestBody List<EquipMaintainSpareReplace> spareReplaceList) {
		ResultBean updateSpareReplace = equipMaintainSpareReplaceService.updateSpareReplace(spareReplaceList);
		return updateSpareReplace;
	}
	
	@ApiOperation("保存按钮")
	@RequestMapping(value = "/saveSpareReplace", method = RequestMethod.POST)
	public ResultBean saveSpareReplace(@RequestBody List<EquipMaintainSpareReplace> spareReplaceList) {
		ResultBean saveSpareReplace = equipMaintainSpareReplaceService.saveSpareReplace(spareReplaceList);
		return saveSpareReplace;
	}
	
	@ApiOperation("批量更换确认")
	@RequestMapping(value = "/batchReplaceConfirm", method = RequestMethod.POST)
		public ResultBean batchReplaceConfirm(@RequestBody List<EquipMaintainSpareReplace> spareReplaceList) {
		ResultBean batchReplaceConfirm = equipMaintainSpareReplaceService.batchReplaceConfirm(spareReplaceList);
		return batchReplaceConfirm;
	}
	
	@ApiOperation("批量需求确认")
	@RequestMapping(value = "/batchDemandConfirm", method = RequestMethod.POST)
	public ResultBean batchDemandConfirm (@RequestBody List<EquipMaintainSpareReplace> beanlist) {
		ResultBean batchDemandConfirm = equipMaintainSpareReplaceService.batchDemandConfirm(beanlist);
		return batchDemandConfirm;
	}
}
